
require 'xmlrpc/client'

class SimpleAuthClient
  
  def initialize(host, port)
    @@server = XMLRPC::Client.new(host, nil, port)
  end
  
  def authenticate(user, pass)
    @@server.call('authenticate', user, pass, ['encrypt', 'test_md5'])
  end
  
  def authorize(service, user, role)
    @@server.call('authorize', service, user, role)
  end
  
end
